import * as React from 'react';

interface AppProps {
    changeFunc: any;
}

interface AppState {
}

export class FooterComponent extends React.Component<AppProps, AppState> {
  constructor(props: AppProps) {
    super(props);

        this.state = {
    }
    this.changePage = this.changePage.bind(this);
  }
  changePage(e: any){
    // console.log(e.target);
    switch (e.target.innerText) {
        case 'a':
            this.props.changeFunc('aModule');
            break;    
        case 'b':
            this.props.changeFunc('bModule');
            break;    
        default:
            break;
    }
  }
  render() {
    return (
      <div className="foot-bar">
        <div className="btn-panel">
            <button onClick={this.changePage}>a</button>
            <button onClick={this.changePage}>b</button>
        </div>
      </div>
    );
  }
}
